<?php

namespace App\Http\Controllers\Api\WebSite;

use App\Http\Controllers\Controller;
use App\Mail\ZiXunMail;
use App\model\agent\AgentCounse;
use Illuminate\Http\Request;

class AgentCounseController extends Controller
{
    /**
     * 提交咨询
     * @param Request $request
     */
    public function create(Request $request){

       $agent= new AgentCounse();
       $agent->name=$request->name;
       $agent->mobile=$request->mobile;
       $agent->sex=$request->sex;
       $agent->quyu_id=$request->quyu_id;
       $agent->area_id=$request->area_id;
       $agent->save();
        \Mail::to('1598095991@qq.com')->queue(new ZiXunMail($agent));
       return response()->json(
           [
               'code'=>0,
               'message'=>'提交成功'
           ]
       );
    }
}
